import React, { Component } from 'react'
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import Login from './pages/login/login'
import Admin from './pages/admin/admin'
import memeryUtils from './utils/memeryUtils'
import storageUtils from './utils/storageUtils'

//进入页面将local中的登录状态存进缓存中
memeryUtils.user = storageUtils.getUser() || {}

export default class App extends Component {
	render() {
		return (
			<BrowserRouter>
				<Switch>
					<Route path="/login" component={Login}></Route>
					<Route path="/" component={Admin}></Route>
				</Switch>
			</BrowserRouter>
		)
	}
}